import { onMounted, ref } from "vue";
// import { useSubcategory } from "./useSubCategoryList";
import { getShopList } from "@/apis/SubCategory";
// const { list } = useSubcategory();

export const useShopList = () => {
  const shopPostData = ref({
    categoryId: 1005000,
    page: 1,
    pageSize: 20,
    sortField: "publishTime",
  });
  const shopList = ref([]);
  const getShop = async () => {
    const {
      data: { result },
    } = await getShopList(shopPostData);
    shopList.value = result.items;
  };

  onMounted(() => {
    getShop();
  });
  return {
    shopList,
    shopPostData,
    getShop
  };
};
